package com.tcm.doctor.web.controller;

import com.base.core.pager.PageBean;
import com.base.core.utils.R;
import com.tcm.doctor.domain.dto.DoctorJobtitlePageDto;
import com.tcm.doctor.domain.vo.DoctorJobtitleVo;
import com.tcm.doctor.service.DoctorJobtitleService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("/doctor/jobtitle")
@RestController
public class DoctorJobtitleController {

    @DubboReference(version = "0.0.1-alpha", timeout = 6000, check = false, retries = 3)
    private DoctorJobtitleService doctorJobtitleService;

    /**
     * 获取所有数据
     * @return
     */
    @GetMapping("/all-list")
    public R allList(){
        List<DoctorJobtitleVo> doctorJobtitleVos = doctorJobtitleService.allJobtitle();
        return R.success(doctorJobtitleVos);
    }

    /**
     * 获取分页数据
     * @param doctorJobtitlePageDto
     * @return
     */
    @GetMapping("/listpage")
    public R listpage(@ModelAttribute DoctorJobtitlePageDto doctorJobtitlePageDto){
        PageBean listBean = doctorJobtitleService.listPage(doctorJobtitlePageDto);
        return R.success(listBean);
    }

}

